<div class="body-content-left">	
	<?php echo  $this->element('fullcalendar',array('plugin'=>'calendar'))?>
</div>
<div class="news body-content-right">
	<h2><?php __('News');?></h2>
	<table cellpadding="0" cellspacing="0"  class="calendar-news">
	<tr>
			<th>&nbsp;</th>
			<th><?php echo $this->Paginator->sort(__d('calendar','Date',true),'News.on_date');?></th>
			<th><?php echo $this->Paginator->sort(__d('calendar','Title',true),'News.name');?></th>
			<th><?php echo $this->Paginator->sort(__d('calendar','Content',true),'News.small_content');?></th>			
	</tr>
	<?php
	$i = 0;
	foreach ($news as $news):
		$class = null;
		if ($i++ % 2 == 0) {
			$class = ' class="altrow"';
		}
	?>
	<tr<?php echo $class;?>>
		<td valign="top"  class="image" >
    		<?php $thumb = $this->Html->url('/', true).str_replace(' ',"%20",$fileUpload->image($news['NewUpload']['name'],array('autoResize'=>true,'width'=>100,'imagePathOnly'=>true)));?>
			<?php echo $this->Html->link("&nbsp;", $news['News']['url'],array('escape'=>false,'class'=>"highslide", 'title'=>$news['News']['name'], 'style'=>"background: url(".$thumb.") center no-repeat;")); ?>    	
		</td>
		<td valign="top"><?php echo $this->Html->link($news['News']['on_date'], array('action' => 'view', $news['News']['id'])); ?>&nbsp;</td>
		<td valign="top"><?php echo $this->Html->link($news['News']['name'], array('action' => 'view', $news['News']['id'])); ?>&nbsp;</td>
		<td valign="top"><?php echo $this->Html->link($news['News']['small_content'], array('action' => 'view', $news['News']['id'])); ?>&nbsp;</td>
	</tr>
<?php endforeach; ?>
	</table>
	<p>
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
	));
	?>	</p>

	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>

<?php		
echo $javascript->codeBlock("
	$(document).ready(function(){
		$(\".actions a[rel^='prettyPhoto']\").prettyPhoto({animationSpeed:'slow',theme:'facebook',slideshow:8000,autoplay_slideshow:false,overlay_gallery:false});
	});		
",$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));
?>

<div class="actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('New News', true), array('action' => 'add','?'=>array('iframe'=>'true','width'=>800,'height'=>600)),array('rel'=>"prettyPhoto[iframe]")); ?></li>
		<li><?php echo $this->Html->link(__('List News', true), array('action' => 'index','?'=>array('iframe'=>'true','width'=>800,'height'=>600)),array('rel'=>"prettyPhoto[iframe]"));?></li>
		<li><?php echo $this->Html->link(__('List News Uploads', true), array('controller' => 'news_uploads', 'action' => 'index','?'=>array('iframe'=>'true','width'=>800,'height'=>600)),array('rel'=>"prettyPhoto[iframe]")); ?> </li>
	</ul>
</div>

<?php  }?>